home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1994 December / PSL Monthly Shareware CD-ROM (Public Software Library)(December 1994).bin / prgmming / dos / asm / assemble.mac < prev    next >
Text File  |  1984-08-27  |  36KB  |  563 lines

  1. type assemb.mac
  2. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  3. ;;                                                                           ;;
  4. ;;                               ASSEMBLE.MAC                                ;;
  5. ;;                                                                           ;;
  6. ;;            Sample macro library for the IBM PC Macro Assembler            ;;
  7. ;;                                                                           ;;
  8. ;;                            (C) Copyright 1983                             ;;
  9. ;;                                    by                                     ;;
  10. ;;                             Jerry D. Stuckle                              ;;
  11. ;;                                                                           ;;
  12. ;;                         Released to Public Domain                         ;;
  13. ;;                                                                           ;;
  14. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  15. Clear   Macro   R1,R2,R3,R4,R5,R6,R7,R8
  16. ;;***************************************************************************;;
  17. ;;                                                                           ;;
  18. ;; Macro: Clear                                                              ;;
  19. ;;                                                                           ;;
  20. ;; Description: Clear registers                                              ;;
  21. ;;                                                                           ;;
  22. ;; Paramaters: Up to 8 registers to be cleared                               ;;
  23. ;;                                                                           ;;
  24. ;; Input: N/A                                                                ;;
  25. ;;                                                                           ;;
  26. ;; Output: Requested registers set to binary 0's                             ;;
  27. ;;                                                                           ;;
  28. ;; Registers Used: None                                                      ;;
  29. ;;                                                                           ;;
  30. ;;***************************************************************************;;
  31.         Irp     Rx,<R1,R2,R3,R4,R5,R6,R7,R8>    ;Register list
  32.         Ifnb    <Rx>                            ;For each register in list
  33.         Xor     Rx,Rx                           ;Clear the register
  34.         Endif                                   ;End of Ifidn
  35.         Endm                                    ;End of Irp
  36.         Endm                                    ;Macro end
  37. Cls     Macro
  38.         Local   Cls1,Clsd
  39. ;;***************************************************************************;;
  40. ;;                                                                           ;;
  41. ;; Macro: Cls                                                                ;;
  42. ;;                                                                           ;;
  43. ;; Description: Clear the display screen                                     ;;
  44. ;;                                                                           ;;
  45. ;; Paramaters: None                                                          ;;
  46. ;;                                                                           ;;
  47. ;; Input: None                                                               ;;
  48. ;;                                                                           ;;
  49. ;; Output: None                                                              ;;
  50. ;;                                                                           ;;
  51. ;; Registers Used: AX,DX                                                     ;;
  52. ;;                                                                           ;;
  53. ;;***************************************************************************;;
  54.         Display Clsd                            ;Display the Dos2 String
  55.         Jmp     Short Cls1                      ;Go around the string data
  56. Clsd    Db      1bh,'[2J$'                      ;Data for Dos Call
  57. Cls1    Label   Near
  58.         Endm
  59. Color   Macro   Foreground,Background
  60.         Local   Cold,Col1
  61. ;;***************************************************************************;;
  62. ;;                                                                           ;;
  63. ;; Macro: Color                                                              ;;
  64. ;;                                                                           ;;
  65. ;; Description: Sets display color                                           ;;
  66. ;;                                                                           ;;
  67. ;; Paramaters: Foreground Color, Background Color                            ;;
  68. ;;                                                                           ;;
  69. ;; Input: None                                                               ;;
  70. ;;                                                                           ;;
  71. ;; Output: None                                                              ;;
  72. ;;                                                                           ;;
  73. ;; Registers Used: AX,DX                                                     ;;
  74. ;;                                                                           ;;
  75. ;;***************************************************************************;;
  76.         Display Cold                            ;Display the color string
  77.         Jmp     Short Col1                      ;Go around the string
  78. Cold    Db      1bh,'['                         ;Start of string
  79.         Ifidn   <Foreground>,<Normal>           ;If normal request
  80.         Db      '0'                             ;Normal Foreground
  81.         Else
  82.         Ifidn   <Foreground>,<Bold>             ;If Bold Request
  83.         Db      '1'                            ;Bold Foreground
  84.         Else
  85.         Ifidn   <Foreground>,<Underscore>       ;If Underscored
  86.         Db      '4'                             ;Underscore Foreground
  87.         Else
  88.         Ifidn   <Foreground>,<Blink>            ;If Blink request
  89.         Db      '5'                             ;Blink Foreground
  90.         Else
  91.         Ifidn   <Foreground>,<Reverse>          ;If Reverse request
  92.         Db      '7'                             ;Reverse Video
  93.         Else
  94.         Ifidn   <Foreground>,<Invisible>        ;If Invisable Request
  95.         Db      '8'                             ;Invisable (No-Show)
  96.         Else
  97.         Ifidn   <Foreground>,<Black>            ;If Black Request
  98.         Db      '30'                            ;Black Foreground
  99.         Else
  100.         Ifidn   <Foreground>,<Red>              ;If Red Request
  101.         Db      '31'                            ;Red Foreground
  102.         Else
  103.         Ifidn   <Foreground>,<Green>            ;If Green Request
  104.         Db      '32'                            ;Green Foreground
  105.         Else
  106.         Ifidn   <Foreground>,<Yellow>           ;If Yellow Request
  107.         Db      '33'                            ;Yellow Foreground
  108.         Else
  109.         Ifidn   <Foreground>,<Blue>             ;If Blue Request
  110.         Db      '34'                            ;Blue Foreground
  111.         Else
  112.         Ifidn   <Foreground>,<Magenta>          ;If Magenta Request
  113.         Db      '35'                            ;Magenta Foreground
  114.         Else
  115.         Ifidn   <Foreground>,<Cyan>             ;If Cyan Request
  116.         Db      '36'                            ;Cyan Foreground
  117.         Else
  118.         Ifidn   <Foreground>,<White>            ;If White Request
  119.         Db      '37'                            ;White Foreground
  120.         Endif
  121.         Endif
  122.         Endif
  123.         Endif
  124.         Endif
  125.         Endif
  126.         Endif
  127.         Endif
  128.         Endif
  129.         Endif
  130.         Endif
  131.         Endif
  132.         Endif
  133.         Endif
  134.         Ifnb    <Foreground>                    ;If we have foreground...
  135.         Ifnb    <Background>                    ;And background colors
  136.         Db      ';'